package test2.divideAndConquer;

import java.util.LinkedList;

public class Solution {
    public int findKthLargest(int[] nums, int k) {
        // 在此处写入代码

        int[] arr = new int[k];
        for (int i = 0;  i< nums.length ; i ++) {
            int j = 0;
            while (j < i && j < k ) {
                if (arr[j] < nums[i] ) {
                    break;
                }
                j++;
            }
            int num = nums[i];
            for (int m = j ; m < k && m <= i; m ++) {
                int n = arr[m];
                arr[m] = num;
                num = n;
            }
        }
        return arr[k-1];
    }
}
